package com.jeesite.modules.wxrobot.service;

import com.jeesite.modules.wxrobot.dao.JsSysEmployeeDao;
import com.jeesite.modules.wxrobot.dao.JsSysUserDao;
import com.jeesite.modules.wxrobot.entity.JsSysEmployee;
import com.jeesite.modules.wxrobot.entity.JsSysUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class JsSysUserService{
    @Autowired
    private JsSysUserDao jsSysUserDao;

    @Autowired
    private JsSysEmployeeDao jsSysEmployeeDao;

    public JsSysUser getUserByOpenId(@Param("wxOpenid") String wxOpenid){
        return jsSysUserDao.getUserByOpenId(wxOpenid);
    }

    public int insertUser(JsSysUser JsSysUser,JsSysEmployee jsSysEmployee){
        jsSysEmployeeDao.insertEmployee(jsSysEmployee);
        return jsSysUserDao.insertUser(JsSysUser);
    }
}
